<div class="header">
  <back-Btn></back-Btn>
  项目扣款
</div>
<div class="container finance">
  <div class="list f_sk">
    <div class="list-item icon_more required" ng-click="chooseProject()">
      <div class="item-label">项目名称</div>
      <div class="flow-content">{{ param.projectName }}</div>
    </div>
    <div rela-module taskid="process_id" param="param" rel="KK_MODULE"></div>
    <div class="list-item icon_more required">
      <div class="item-label">扣款方式</div>
      <div class="flow-content">
        <select ng-model="param.closeOutType" ng-options="item.value as item.key for item in deductTypeList">
          <option value="">选择扣款方式</option>
        </select>
      </div>
    </div>
    <div class="list-item list-item-textarea">
      <div class="item-label">备注</div>
      <div class="flow-content">
        <textarea cols="30" rows="10" ng-model="param.remark"></textarea>
      </div>
    </div>
    <!-- 自定义字段 -->
    <div user-defined field-map="param.fieldMap" validation="validation" uid="param.uid"
      processid="param.processInstanceId"></div>
    <div class="list table-list">
      <div class="info-title">
        扣款明细
        <span class="c-blue fr" ng-click="showCertificate()">添加</span>
      </div>

      <div class="table-item" ng-repeat="item in param.details">
        <div class="content" ng-class="{cur:$index==costindex}" ng-click="resetlist(0)" ng-swipe-left="swipe($index,0)"
          ng-swipe-right="swipe(-1,0)">
          <div class="list-item">
            <div class="item-label">款项类别</div>
            <div class="flow-content">
              {{ item.deductType | getnamefromvalue }}
            </div>
          </div>
          <div class="list-item">
            <div class="item-label">款项小类</div>
            <div class="flow-content">{{ item.deductName }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">扣款金额</div>
            <div class="flow-content">{{ item.deductAmount }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">扣款事由</div>
            <div class="flow-content">{{ item.deductRemark }}</div>
          </div>
          <div class="file-upload" file-list file-data="item.deductAttachment"></div>
        </div>
        <div class="delete_icon icon_del" ng-click="deletedItem($index)"></div>
      </div>
    </div>
    <div class="list table-list" ng-show="param.invoices&&param.invoices.length>0">
      <div class="info-title">
        本次扣款对应的销项发票
      </div>
      <div class="table-item" ng-repeat="item in param.invoices ">
        <div class="content">
          <div class="list-item">
            <div class="item-label">编号</div>
            <div class="flow-content">
              {{ item.invoiceNo }}
            </div>
          </div>
          <div class="list-item">
            <div class="item-label">申请日期</div>
            <div class="flow-content">{{ item.applyDate|dateFmt }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">发票类型</div>
            <div class="flow-content">{{ item.invoiceType }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">发票税率</div>
            <div class="flow-content">{{ item.taxRate }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">发票税额</div>
            <div class="flow-content">{{ item.taxAmount|NBFmt }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">发票金额</div>
            <div class="flow-content">{{ item.totalAmount|NBFmt }}</div>
          </div>
        </div>
      </div>
    </div>
    <!-- 附件 -->
    <div class="file-upload" file-upload file-data="param.attachment"></div>
    <!-- 审查日志 -->
    <div log-list taskid="process_id"></div>
  </div>
</div>
<!-- 删除流程 -->
<div delete-flow uid="param.uid" id="{{ param.processInstanceId }}" submit="submit" validate="validate"></div>
<!-- 扣款明细 -->
<div class="list tablestyle pickceritem" ng-show="showCerPicker">
  <div class="list-item f_sk">
    <div class="grid list-content icon_enter required">
      <div class="col-1-4">款项类别</div>
      <div class="col-3-4">
        <select name="sex" id="sexSelect" ng-model="picker.deductType" ng-change="costTypechange()"
          ng-options="item.value as item.key for item in costTypeList">
          <option value="">选择款项类型</option>
        </select>
      </div>
    </div>
    <div class="grid list-content icon_enter">
      <div class="col-1-4">款项小类</div>
      <div class="col-3-4">
        <select ng-model="picker.deductName" ng-options="item.value as item.key for item in costsubTypeList">
        </select>
      </div>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">扣款金额</div>
      <div class="col-3-4">
        <input type="text" tel-directive ng-model="picker.deductAmount" />
      </div>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">扣款事由</div>
      <div class="col-3-4">
        <input type="text" ng-model="picker.deductRemark" />
      </div>
    </div>
    <div class="file-upload" file-upload file-data="picker.deductAttachment" maxnum=1></div>
  </div>
  <div class="pickceritem-btn tc flex">
    <div class="cancel" ng-click="closePicker()">取消</div>
    <div class="confirm" ng-click="addCertificate()">确定</div>
  </div>
</div>